import 'package:flutter/material.dart';

class FreeFlowNewPage extends StatefulWidget {
  const FreeFlowNewPage({Key key}) : super(key: key);

  @override
  _FreeFlowNewPageState createState() => _FreeFlowNewPageState();
}

class _FreeFlowNewPageState extends State<FreeFlowNewPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('免流量看新闻'),
        ),
        body: Container(
          margin: EdgeInsets.all(20),
          child: Center(
            child: ListView(
              // mainAxisAlignment: MainAxisAlignment.start,
              // crossAxisAlignment: CrossAxisAlignment.c,
              children: [
                buildCard(),
                buildCard(),
                buildCard(),
                buildCard(),
                buildCard(),
              ],
            ),
          ),
        ));
  }

  Widget buildCard() {
    return Card(
      color: Colors.white,

      ///设置阴影
      elevation: 5,

      ///设置圆角
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(10))),
      child: Container(
          padding: EdgeInsets.only(top: 20, bottom: 20),
          // margin: EdgeInsets.all(10),
          width: 300,
          height: 140,
          child: Padding(
            padding: const EdgeInsets.all(10.0),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                Container(
                  width: 300,
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Row(
                        children: [
                          Text(
                            '网易乐卡',
                            style: TextStyle(
                                fontSize: 17,
                                color: Colors.black,
                                fontWeight: FontWeight.w700),
                          ),
                          Icon(Icons.ac_unit)
                        ],
                      ),
                      SizedBox(
                        height: 10,
                      ),
                      Text('网易游戏、网易云音乐及网易新闻等网易系应用免流量畅玩',
                          style: TextStyle(
                            fontSize: 14,
                            color: Colors.grey,
                          )),
                    ],
                  ),
                ),
                Expanded(child: Container()),
                Row(
                  children: [
                    ElevatedButton(
                      onPressed: () {},
                      style: ButtonStyle(
                          side: MaterialStateProperty.all(
                            BorderSide(color: Colors.red, width: 1),
                          ),
                          shape: MaterialStateProperty.all(StadiumBorder()),
                          backgroundColor:
                              MaterialStateProperty.all(Colors.white)),
                      child: Text(
                        'data',
                        style: TextStyle(color: Colors.red),
                      ),
                    )
                  ],
                )
              ],
            ),
          )),
    );
  }
}
